]> dgit.raspbian.org Git - gnome-shell.git/commit
keyboard: Ignore focus rects outside the window
authorJonas Dreßler <verdre@v0yd.nl>
Sat, 27 Feb 2021 10:27:23 +0000 (11:27 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 12 Mar 2021 15:56:12 +0000 (15:56 +0000)
commit746230f8b68fee9efb314f0acade5f65c626c2b3
treee498d948f07921c8217c35f5e4c26b2aa9c1988d
parent7c83cbe1355e2e722f056862a7dd649bb9d5daf0
keyboard: Ignore focus rects outside the window

Apparently some clients, including gtk don't "clip" the focus rectangle
to their window bounds when scrolling the focus outside the window. This
makes us shift up windows when the focus actually is no longer visible.

This issue needs fixing in GTK, it should probably stop reporting
focus changes when the focus moves outside of the visible view. We can
still do a little bit better on our side though and "clip" the rectangle
to the windows frame rect: If it moves out of the window, we simply stop
updating our focus rect.

The intersection check introduces a small problem though: Some clients
(for example gedit) will give us a cursor rect that has a 0 width or
height. This won't play well with graphene_rect_intersect()
(GrapheneRects never intersect if they are 0-sized), so we set the size
to 1 in case we get a 0-sized rectangle.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1728>
js/ui/keyboard.js